package org.example.bao1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component(value = "mystudet")
public class studet {
    @Value(value = "张三")
    private String name;
   // @Value("${xuehao}") 配置文件中取值
    private int xuehao;
    @Autowired
    @Qualifier("schooldx1")
    private school xuexiao;
    @Resource
    private school xuexiao2;

    public void setXuexiao(school xuexiao) { //得传一个对象
        this.xuexiao = xuexiao;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getXuehao() {
        return xuehao;
    }
        @Value("22")
    public void setXuehao(int xuehao) {
        this.xuehao = xuehao;
    }
}
